package com.aegis.core.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Author wuweixin
 *
 * @Version 1.0
 * @Descritube
 */
public class AegisLogUtil {

    private AegisLogUtil() {
        throw new IllegalStateException("Utility class");
    }

    private static Logger getLogger() {
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        // 获取调用 LogUtil 的类
        String className = stackTrace[3].getClassName();
        return LoggerFactory.getLogger(className);
    }

    public static void info(String message, Object... args) {
        getLogger().info(message, args);
    }

    public static void debug(String message, Object... args) {
        getLogger().debug(message, args);
    }

    public static void error(String message, Object... args) {
        getLogger().error(message, args);
    }
}
